package com.qianli.cashmama.product.server.controller;

import com.qianli.cashmama.product.server.cache.ProductCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class ProductManagerController {

    @Autowired
    private ProductCache productCache;

    @RequestMapping("/product/manager/reloadCache")
    @ResponseBody
    public String productCacheSwitch() {
        long start = System.currentTimeMillis();
        productCache.loadCache();
        long end = System.currentTimeMillis();
        return "" + (end - start) + "ms";
    }
}
